{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from selenium import webdriver\n",
    "from selenium.webdriver import ActionChains\n",
    "from selenium.common import exceptions\n",
    "from selenium.webdriver.common.by import By\n",
    "from selenium.webdriver.support import expected_conditions as EC\n",
    "from selenium.webdriver.support.ui import Select, WebDriverWait\n",
    "import time\n",
    "import random\n",
    "import time\n",
    "import requests\n",
    "import re\n",
    "import json\n",
    "import pickle\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.3538.102 Safari/537.36'\n",
    "user_agent = \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36\"\n",
    "# user_agent = 'Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; InfoPath.3; rv:11.0) like Gecko'\n",
    "locator = (By.ID, 'mallPage')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 235,
   "metadata": {},
   "outputs": [],
   "source": [
    "fp = webdriver.FirefoxProfile()\n",
    "fp.set_preference(\"general.useragent.override\", user_agent)\n",
    "# fp.set_preference('network.proxy.type', 1)\n",
    "# fp.set_preference('network.proxy.http', proxy_url)\n",
    "# fp.set_preference('network.proxy.http_port', int(port))\n",
    "# fp.set_preference('network.proxy.ssl', proxy_url)\n",
    "# fp.set_preference('network.proxy.ssl_port', int(port))\n",
    "fp.update_preferences()\n",
    "driver = webdriver.Firefox(firefox_profile=fp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 192,
   "metadata": {},
   "outputs": [],
   "source": [
    "# driver.get('http://www.useragentstring.com/')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 193,
   "metadata": {},
   "outputs": [],
   "source": [
    "driver.get('https://only.m.tmall.com/shop/shop_auction_search.htm?sort=default')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 236,
   "metadata": {},
   "outputs": [],
   "source": [
    "def set_navigator():\n",
    "    script_webdriver = '''Object.defineProperties(navigator,{\n",
    "    webdriver:{\n",
    "    get:() => false\n",
    "    }\n",
    "    })'''\n",
    "    script_language = ''' Object.defineProperty(navigator, 'languages', {\n",
    "        get: () => [ \"zh-CN\", \"zh\", \"zh-TW\", \"zh-HK\", \"en-US\", \"en\" ],\n",
    "      });'''\n",
    "    driver.execute_script(script_webdriver)\n",
    "    driver.execute_script(script_language)\n",
    "    print('navigator set successfully')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 170,
   "metadata": {},
   "outputs": [],
   "source": [
    "# set_navigator()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 237,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "navigator set successfully\n"
     ]
    }
   ],
   "source": [
    "driver.refresh()\n",
    "set_navigator()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 248,
   "metadata": {},
   "outputs": [],
   "source": [
    "driver.get('https://list.tmall.com/search_product.htm?q=浴巾&type=p&vmarket=&spm=875.7931836%2FB.a2227oh.d100&from=mallfp..pc_1_searchbutton')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 173,
   "metadata": {},
   "outputs": [],
   "source": [
    "# with open('d:\\\\test\\\\all_brand_lst', 'rb') as f:\n",
    "#     all_brand_lst = pickle.loads(f.read())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 239,
   "metadata": {},
   "outputs": [],
   "source": [
    "def scroll_window_home():\n",
    "    for i in range(1, 10):\n",
    "        time.sleep(1)\n",
    "        loca = 1000 * i\n",
    "        driver.execute_script(\"var q=document.documentElement.scrollTop={}\".format(loca))\n",
    "    return '****屏幕滚动完毕'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 点击更多，获取品牌清单和brandid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 249,
   "metadata": {},
   "outputs": [],
   "source": [
    "driver.find_element_by_css_selector('#J_NavAttrsForm > div > div.brandAttr.j_nav_brand > div > div.attrValues > div.av-options > a.j_More.avo-more.ui-more-drop-l').click()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 251,
   "metadata": {},
   "outputs": [],
   "source": [
    "all_brand = driver.find_elements_by_css_selector('#J_NavAttrsForm > div > div.brandAttr.j_nav_brand > div > div.attrValues > ul > li')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 获取所有的品牌名和品牌链接"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 252,
   "metadata": {},
   "outputs": [],
   "source": [
    "all_brand_lst = []\n",
    "for one_brand in all_brand:\n",
    "    ahref = one_brand.find_element_by_css_selector('a')\n",
    "    one_brand_href = ahref.get_attribute('href')\n",
    "    all_brand_lst.append((ahref.text, one_brand_href))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 253,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "199"
      ]
     },
     "execution_count": 253,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(all_brand_lst)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 循环获取所有的品牌前5页的宝贝数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 268,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Purcotton/全棉时代 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "Disney/迪士尼 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "毛毛雨 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "ESPRIT/埃斯普利特 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "TAYOHYA/多样屋 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n",
      "恒源祥 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "MUJI 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "珍喜 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "图强 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n",
      "need pause\n",
      "\n",
      "navigator set successfully\n",
      "奥德朗 正在访问\n",
      "****屏幕滚动完毕\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n",
      "名博士 正在访问\n",
      "****屏幕滚动完毕\n",
      "\n",
      "共有2页，第1页正在下载\n",
      "****屏幕滚动完毕\n",
      "1 finished!!\n",
      "navigator set successfully\n",
      "共有2页，第2页正在下载\n",
      "****屏幕滚动完毕\n",
      "2 finished!!\n",
      "navigator set successfully\n"
     ]
    }
   ],
   "source": [
    "new_brand = []\n",
    "for one_name, one_link in all_brand_lst[10:21]:\n",
    "    print(one_name, '正在访问')\n",
    "    driver.get(one_link)\n",
    "    print(scroll_window_home())\n",
    "    if driver.title == 'security-X5':\n",
    "        input()\n",
    "#     else:\n",
    "#         try:\n",
    "#             totalpage_css = driver.find_element_by_css_selector('#content > div > div.ui-page > div > b.ui-page-skip > form > input[type=\"hidden\"]:nth-child(4)')\n",
    "#             totalpage = totalpage_css.get_attribute('value')\n",
    "#         except exceptions.StaleElementReferenceException:\n",
    "#             input('请滑动解锁：')\n",
    "#             totalpage_css = driver.find_element_by_css_selector('#content > div > div.ui-page > div > b.ui-page-skip > form > input[type=\"hidden\"]:nth-child(4)')\n",
    "#             totalpage = totalpage_css.get_attribute('value')\n",
    "    # 只获取每个品牌前5页的数据\n",
    "    for one_page in range(1, 3):\n",
    "        print('共有{}页，第{}页正在下载'.format(2, one_page))\n",
    "        if '浴巾' in driver.title:\n",
    "            try:\n",
    "                print(scroll_window_home())\n",
    "#                 driver.find_elements_by_id('J_ItemList')\n",
    "                one_page_item = driver.find_elements_by_xpath('//*[@id=\"J_ItemList\"]/div')\n",
    "                one_page_content = []\n",
    "                for one_item in one_page_item:\n",
    "                    try:\n",
    "                        price = one_item.find_elements_by_css_selector('div > p.productPrice')[0].text\n",
    "                        title = one_item.find_elements_by_css_selector('div > p.productTitle')[0].text\n",
    "                        shopname = one_item.find_elements_by_css_selector('div.product-iWrap > div.productShop > a')[0].text\n",
    "                        monthsold = one_item.find_elements_by_css_selector('div > p.productStatus')[0].text.split('\\n')[0]\n",
    "                        comments = one_item.find_elements_by_css_selector('div > p.productStatus')[0].text.split('\\n')[1]\n",
    "                        item_id = one_item.get_attribute('data-id')\n",
    "                    except exceptions.StaleElementReferenceException:\n",
    "                        print('数据抓取失败')\n",
    "                        item_id, price, title, shopname, monthsold, comments = (1,)*6\n",
    "                    one_item_content = (one_name, item_id, price, title, shopname, monthsold, comments, one_page)\n",
    "                    one_page_content.append(one_item_content)\n",
    "                one_page_df = pd.DataFrame(one_page_content)\n",
    "                one_page_df.to_csv('d:\\\\test\\\\浴巾.csv', mode='a+')\n",
    "                print('{} finished!!'.format(one_page))\n",
    "                if one_page < int(totalpage):\n",
    "                    driver.refresh()\n",
    "                    set_navigator()\n",
    "                    driver.find_elements_by_css_selector('#content > div > div.ui-page > div > b.ui-page-num > a.ui-page-next')[0].click()\n",
    "                    WebDriverWait(driver, 60).until(EC.presence_of_element_located(locator))\n",
    "                    driver.implicitly_wait(60)\n",
    "                    time.sleep(random.randint(30,60))\n",
    "            except (exceptions.TimeoutException, IndexError):\n",
    "                time.sleep(random.randint(20,50))\n",
    "                print('need pause')\n",
    "                input()\n",
    "                driver.refresh()\n",
    "                set_navigator()\n",
    "#                 driver.find_elements_by_css_selector('#content > div > div.ui-page > div > b.ui-page-num > a.ui-page-next')[0].click()\n",
    "#                 WebDriverWait(driver, 20).until(EC.presence_of_element_located(locator))\n",
    "#                 driver.implicitly_wait(1)\n",
    "    new_brand.append(one_link)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 获取每个宝贝的前50页评论数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 粘贴所有的宝贝itemid"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 271,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "543266986647"
      ]
     },
     "execution_count": 271,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "items = [543266986647,\n",
    "        37796960279,\n",
    "        565540897283,\n",
    "        569476982667,\n",
    "        576706883047,\n",
    "        39591746165,\n",
    "        540724145574,\n",
    "        40793287662,\n",
    "        8770979382,\n",
    "        536281879052,\n",
    "        44419476009,\n",
    "        533663913423,\n",
    "        14301222399,\n",
    "        580214360871,\n",
    "        19274370868,\n",
    "        41504319950,\n",
    "        521061004169,\n",
    "        521787359561,\n",
    "        37261812229,\n",
    "        567262688919,\n",
    "        581271363893,\n",
    "        571941907638,\n",
    "        579293743558,\n",
    "        578328583724,\n",
    "        573605888770,\n",
    "        568774517831,\n",
    "        577058487070,\n",
    "        564743340617,\n",
    "        564744160043,\n",
    "        564843845513]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 332,
   "metadata": {},
   "outputs": [],
   "source": [
    "driver.get('https://detail.tmall.com/item.htm?id=543266986647')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 设置滚屏软件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 334,
   "metadata": {},
   "outputs": [],
   "source": [
    "def scroll_window_comment():\n",
    "    for i in range(1, 34):\n",
    "        time.sleep(1)\n",
    "        loca = 1000 * i\n",
    "        driver.execute_script(\"var q=document.documentElement.scrollTop={}\".format(loca))\n",
    "    return '****屏幕滚动成功'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 获取所有页面的评论数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [],
   "source": [
    "rate_fulltxt = driver.find_elements_by_css_selector('div.tm-rate-fulltxt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "metadata": {},
   "outputs": [],
   "source": [
    "def one_page_func(page):    \n",
    "    count = 1\n",
    "    one_page_comment = []\n",
    "    rate_fulltxt = driver.find_elements_by_css_selector('div.tm-rate-fulltxt')\n",
    "    for one_comment in rate_fulltxt:\n",
    "        comment = one_comment.text\n",
    "        count += 1\n",
    "        one_page_comment.append((comment, 'page{}_{}'.format(page, count)))\n",
    "    return one_page_comment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 338,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "578328583724--page--------1\n",
      "578328583724--page--------2\n",
      "578328583724--page--------3\n",
      "573605888770--page--------1\n",
      "573605888770--page--------2\n",
      "573605888770--page--------3\n",
      "568774517831--page--------1\n",
      "568774517831--page--------2\n",
      "568774517831--page--------3\n",
      "577058487070--page--------1\n",
      "577058487070--page--------2\n",
      "577058487070--page--------3\n",
      "564743340617--page--------1\n",
      "564743340617--page--------2\n",
      "564743340617--page--------3\n",
      "564744160043--page--------1\n",
      "564744160043--page--------2\n",
      "564744160043--page--------3\n",
      "564843845513--page--------1\n",
      "564843845513--page--------2\n",
      "564843845513--page--------3\n"
     ]
    }
   ],
   "source": [
    "for one_item in items[-7:]:\n",
    "    driver.get('https://detail.tmall.com/item.htm?id={}'.format(one_item))\n",
    "    for page in range(1, 4):\n",
    "        print('{}--page--------{}'.format(one_item, page))\n",
    "        scroll_window_comment()\n",
    "        scroll_add_crowd_button = driver.find_elements_by_css_selector('#J_Reviews > div > div.rate-grid > table > tbody > tr:nth-child(20)')[-1]\n",
    "        driver.execute_script(\"arguments[0].scrollIntoView();\", scroll_add_crowd_button)\n",
    "        one_page_df = pd.DataFrame(one_page_func(page))\n",
    "        one_page_df['itemid'] = one_item\n",
    "        one_page_df.to_csv('d:\\\\test\\\\毛巾评论.csv', mode='a+', encoding='utf-8')\n",
    "        time.sleep(random.randint(10, 20))\n",
    "        page_name = driver.find_elements_by_css_selector('#J_Reviews > div > div.rate-page > div > a')[-1].text\n",
    "        if page_name == '下一页>>':\n",
    "            driver.find_elements_by_css_selector('#J_Reviews > div > div.rate-page > div > a')[-1].click()\n",
    "        else:\n",
    "            driver.find_elements_by_css_selector('#J_Reviews > div > div.rate-page > div > a')[-1].click()\n",
    "       "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 327,
   "metadata": {},
   "outputs": [],
   "source": [
    "# driver.find_elements_by_css_selector('#J_Reviews > div > div.rate-page > div > a')[-1].click()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 326,
   "metadata": {},
   "outputs": [],
   "source": [
    "# scroll_add_crowd_button = driver.find_elements_by_css_selector('#J_Reviews > div > div.rate-grid > table > tbody > tr:nth-child(20)')[-1]\n",
    "# driver.execute_script(\"arguments[0].scrollIntoView();\", scroll_add_crowd_button)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# driver.find_elements_by_css_selector('#J_Reviews > div > div.rate-page > div > a')[-1].click()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 330,
   "metadata": {},
   "outputs": [
    {
     "ename": "IndexError",
     "evalue": "list index out of range",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-330-2d44d42f87ca>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mdriver\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfind_elements_by_css_selector\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'#J_Reviews.J_DetailSection tm-curTab'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclick\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m: list index out of range"
     ]
    }
   ],
   "source": [
    "# driver.find_elements_by_css_selector('#J_Reviews.J_DetailSection tm-curTab')[0].click()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 339,
   "metadata": {},
   "outputs": [],
   "source": [
    "l = [1,2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 340,
   "metadata": {},
   "outputs": [],
   "source": [
    "p = [2, 3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 341,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 2, 3]"
      ]
     },
     "execution_count": 341,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "l + p"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 344,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "87"
      ]
     },
     "execution_count": 344,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "1388//16+1"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
